Skip to content

feat(zed): rename the extension id and reap superseded binaries - #203

Merged
sunerpy merged 1 commit into
mainfrom
feat/zed-extension-id-and-cleanup
Aug 16, 2026
Merged

sunerpy merged 1 commit into
mainfrom
feat/zed-extension-id-and-cleanup

Conversation

@sunerpy

@sunerpy sunerpy commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Addresses the review on zed-industries/extensions#6732.

Extension id → mcp-server-codegraph

The Zed publishing prerequisites require an id that conveys what the extension does, with an exception only for "languages or popular tooling that people would expect to find under that ID". A bare codegraph does not qualify, so the id changes.

Prefix form, not suffix, measured against the live registry: 44 mcp-server-* entries, 0 *-mcp-server entries. The maintainer's own precedent (#4861) landed as mcp-server-zuraffa. An id cannot be changed after publication, so this follows the 44 precedents.

name becomes CodeGraph MCP Server; Zed searches name too, so typing "codegraph" still finds it.

[context_servers.codegraph] is deliberately unchanged

The context-server key is not required to equal the extension id — the published chrome-devtools-mcp declares [context_servers.chrome-devtools-mcp-zed] under id = "chrome-devtools-mcp". Renaming ours would break every context_servers.codegraph entry that codegraph install / codegraph init --target=zed has already written, plus every hand-written config, for no gain.

Auto-cleanup of superseded binaries

Each launch resolves the latest release and caches it under codegraph-<version>/, so the work directory previously kept every version it had ever downloaded. It now reaps superseded codegraph-* dirs, with three deliberate properties:

  • gated on the download path — a version-stamped cache hit returns earlier and never reaps;
  • prefix-scoped, current version kept — unrelated state in the work dir survives;
  • best-effort removal (.ok()) — a dir that cannot be deleted, such as an in-use .exe on Windows, must never fail a server launch.

This matches zed-industries/zed's own proto and test-extension helpers.

Verification

  • Built for real against wasm32-wasip2 (target installed rather than substituting cargo check); clippy -D warnings clean, both run inside editors/zed/.
  • Cleanup behaviour exercised on a staged work dir: old version dirs removed, current kept, unrelated dirs untouched.
  • Zero diff against crates/, the root Cargo.toml/Cargo.lock, reference/, and CI; make ci green at 127 suites / 3146 passed / 0 failed.

Two pre-existing doc errors in the paragraph this touched are corrected: the cache path is extensions/work/<id>/, not extensions/installed/<id>/, and the Windows data root is %LOCALAPPDATA%\Zed, not %APPDATA%\Zed.

The Zed registry requires an extension id that conveys what the extension
does; the bare `codegraph` only qualifies under the exception for widely
known tooling, which does not apply. Rename to `mcp-server-codegraph`: the
registry carries 44 `mcp-server-*` entries and no `*-mcp-server` ones, and an
id cannot be changed after publication.

The `[context_servers.codegraph]` key stays. It is not required to match the
extension id — the published `chrome-devtools-mcp` declares a different one —
and `codegraph install` plus every hand-written Zed config already reference
`context_servers.codegraph`.

Reap superseded `codegraph-*` version dirs after a successful download so the
extension work directory stops growing with every release. The reap is gated
on the download path, so a cache hit never runs it; it is prefix-scoped, so
unrelated state survives; and removal is best-effort, so a directory that
cannot be deleted never fails a launch.
@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #203      +/-   ##
==========================================
+ Coverage   95.16%   95.17%   +0.01%     
==========================================
  Files         136      136              
  Lines       72320    72936     +616     
==========================================
+ Hits        68822    69420     +598     
- Misses       3498     3516      +18     

see 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sunerpy
sunerpy merged commit 188b8b6 into main Aug 16, 2026
7 checks passed
@sunerpy
sunerpy deleted the feat/zed-extension-id-and-cleanup branch August 16, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant